<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date') ?>

<?php use_stylesheet('/sf/sf_admin/css/main') ?>

<div id="sf_admin_container">

<div class="title"><?php echo __('Select module') ?></div>

<div class="naujiena">
<div id="sf_admin_content">

<div class="form-row">
  <?php echo label_for(
                'current_module'
                , __('Current module')
                , ''
            ) ?>
    <div class="content">
<?php if( $tree->getObjType() == MyConstants::TYPE_TEXTMODULE ): ?>
    <?php echo __('It`s text module.')?>
    You have <?php echo Files::countObjects($tree->getObjId(), MyConstants::TYPE_TEXTMODULE, null) ?> files. Are you sure you want to drop this module?!

<?php elseif( $tree->getObjType() == MyConstants::TYPE_GALLERY ): ?>
    <?php echo __('It`s gallery module.')?>
    You have <?php echo Files::countObjects($tree->getObjId(), MyConstants::TYPE_GALLERY, null) ?> files. Are you sure you want to drop this module?!

<?php elseif( $tree->getObjType() == MyConstants::TYPE_LINK_TO ): ?>
    <?php echo __('It`s link module.')?>
<?php elseif( $tree->getObjType() == MyConstants::TYPE_CATEGORY ): ?>
    <?php echo __('It`s category module.')?>
    You have <?php echo Files::countObjects($tree->getObjId(), MyConstants::TYPE_CATEGORY, null) ?> files. Are you sure you want to drop this module?!

<?php else: ?>

    <?php echo __('No module for current page') ?>

<?php endif; ?>
    </div>
</div>

<div class="form-row">
  <?php echo label_for(
                'reset_module'
                , __('Reset module')
                , ''
            ) ?>
    <div class="content">
    <?php echo link_to(
                    image_tag(
                        'module_reset.png'
                        , array(
                            'border' => 0
                            , 'alt' => __('Reset module')
                            , 'title' => __('Reset module')
                        )
                    )
                    , 'tree/resetmodule?id=' . $tree->getId()
                    , array(
                        'confirm' => __('Are you sure?!')
                    )
                ) ?>
    </div>
</div>


<div class="form-row">
  <?php echo label_for(
                'module_list'
                , __('New module')
                , ''
            ) ?>
  <div class="content">
<?php foreach( MyConstants::getTypesList() as $key => $value ): ?>

    <?php if( $key != $tree->getObjType() ): ?>
        <?php echo link_to(
                        image_tag(
                            'module_' . $value . '.png'
                            , array(
                                'border' => 0
                                , 'alt' => __('Change to ' . $value . ' module')
                                , 'title' => __('Change to ' . $value . ' module')
                            )
                        )
                        , 'tree/change?id=' . $tree->getId() . '&module_type=' . $key
                        , array(
                            'confirm' => __('Are you sure?!')
                        )
                    ) ?>
    <?php endif; ?>

<?php endforeach; ?>
    </div>
</div>



<ul class="sf_admin_actions">
  <li><?php echo button_to(
                    __('list')
                    , 'tree/list'
                    , array (
                        'class' => 'sf_admin_action_list',
                    )
                ) ?></li>
</ul>


</form>

</div>

<div id="sf_admin_footer">


</div>

</div>
</div>